//
//  InputViewController.m
//  shiyan
//
//  Created by MAC on 15-11-24.
//  Copyright (c) 2015年 me. All rights reserved.
//

#import "InputViewController.h"
#import "ViewController.h"
@interface InputViewController ()<UITextFieldDelegate>
{
    UITextField * tf;
}
@end

@implementation InputViewController

-(void)viewDidLoad{
    tf = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44)];
    tf.text = self.tels;
    tf.clearButtonMode = UITextFieldViewModeAlways;
    tf.delegate = self;
    //
    //[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"tels"];
    
}
//保存
//return
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    [self.delegate inputFinished:textField.text];
    
    return YES;
}


-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [tf becomeFirstResponder];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    [cell addSubview:tf];
    return cell;
}




- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
